<?php
namespace common\model;

/**
 * 模型数据库操作类
 */
load_class('model', '', 0);
class common_model extends \model
{
    protected $outParams = null;

    /**
     * 保留外部变量
     * @param $key
     * @param string $value
     * @return bool
     */
    public function setOutParams($key,$value='')
    {
        if(empty($key)){
            return false;
        }
        if(is_array($key)){
            foreach($key AS $k=>&$v){
                $this->outParams[$k] = $v;
            }
        }else{
            $this->outParams[$key] = $value;
        }
        return true;
    }

    public function unsetOutParams()
    {
        $this->outParams = null;
        return true;
    }

    /**
     * 获取外部变量的数值
     * @param string $key
     * @return null
     */
    public function getOutParams($key='')
    {
        return $key ? $this->outParams[$key] :$this->outParams;
    }
    
}